package helper

import (
	"crypto/md5"
	"fmt"
	"math/rand"
	"strconv"
	"time"
)

func RandomStringNum() string {
	r := rand.New(rand.NewSource(time.Now().UnixNano()))
	return strconv.Itoa(int(r.Int31()))
}

func RandMd5String() string {
	var a = make([]byte, 32)
	if _, err := rand.Read(a); err != nil {
		return ""
	}

	return fmt.Sprintf("%x", md5.Sum(a))
}
